package com.zhanghu.backendZray.job;

import com.zhanghu.backendZray.service.UserOnlineTokenService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 用户在线状态定期check
 * @author ZhangDong
 * @date 2024/9/6 11:14
 */
@Component
@Slf4j
@RequiredArgsConstructor
public class LoginStatusJob {
    private final UserOnlineTokenService userOnlineTokenService;


    /**
     * 五分钟执行一次
     */
    @Scheduled(fixedRate = 1000 * 300, initialDelay = 5000)
    public void loginStatusCheck() {
        userOnlineTokenService.loginStatusCheck();
    }
}
